package pl.plesken.xml;

import java.io.File;
import java.io.IOException;

import noNamespace.LibraryDocument;

import org.apache.xmlbeans.XmlException;

public class SetMoviesXML {

	public LibraryDocument loadData(String file) throws XmlException, IOException {
		File xmlFile = new File(file);
		LibraryDocument library = LibraryDocument.Factory.parse(xmlFile);
		return library;
	}
	
	public String postersPerspective(LibraryDocument library) {
		String val = library.getLibrary().getPreferences().getPostersPerspective();
		return val;
	}
	
	public String posterWidth(LibraryDocument library) {
		String val = library.getLibrary().getPreferences().getPostersWidth();
		return val;
	}
	
	public String posterHeight(LibraryDocument library) {
		String val = library.getLibrary().getPreferences().getPostersHeight();
		return val;
	}
	
	public String thumbnailWidth(LibraryDocument library) {
		String val = library.getLibrary().getPreferences().getThumbnailsWidth();
		return val;
	}
	
	public String thumbnailHeight(LibraryDocument library) {
		String val = library.getLibrary().getPreferences().getThumbnailsHeight();
		return val;
	}
	
	public String perspectiveTopPoster(LibraryDocument library) {
		String val = library.getLibrary().getPreferences().getPostersPerspectiveTop();
		return val;
	}

	public String perspectiveBottomPoster(LibraryDocument library) {
		String val = library.getLibrary().getPreferences().getPostersPerspectiveBottom();
		return val;
	}

	public String perspectiveTopThumbnail(LibraryDocument library) {
		String val = library.getLibrary().getPreferences().getThumbnailsPerspectiveTop();
		return val;
	}

	public String perspectiveBottomThumbnail(LibraryDocument library) {
		String val = library.getLibrary().getPreferences().getThumbnailsPerspectiveBottom();
		return val;
	}
	
	public String posterReflectionHeight(LibraryDocument library) {
		String val = library.getLibrary().getPreferences().getPostersReflectionHeight();
		return val;
	}
	
	public String thumbnailReflectionHeight(LibraryDocument library) {
		String val = library.getLibrary().getPreferences().getThumbnailsReflectionHeight();
		return val;
	}

	public Boolean perspectiveThumbnail(LibraryDocument library) {
		Boolean val = Boolean.valueOf(library.getLibrary().getPreferences().getThumbnailsPerspective());
		return val;
	}
	
	public String perspectiveDirection(LibraryDocument library) {
		String val = library.getLibrary().getPreferences().getPostersPerspectiveDirection();
		return val;
	}
	
	public Boolean logoHD(LibraryDocument library) {
		Boolean val = Boolean.valueOf(library.getLibrary().getPreferences().getPostersLogoHD());
		return val;
	}

	public Boolean logoTV(LibraryDocument library) {
		Boolean val = Boolean.valueOf(library.getLibrary().getPreferences().getPostersLogoTV());
		return val;
	}
	
	public Boolean logoThumbHD(LibraryDocument library) {
		Boolean val = Boolean.valueOf(library.getLibrary().getPreferences().getThumbnailsLogoHD());
		return val;
	}

	public Boolean logoThumbTV(LibraryDocument library) {
		Boolean val = Boolean.valueOf(library.getLibrary().getPreferences().getThumbnailsLogoTV());
		return val;
	}
	
	public Boolean posterReflection(LibraryDocument library) {
		Boolean val = Boolean.valueOf(library.getLibrary().getPreferences().getPostersReflection());
		return val;
	}
	
	public Boolean thumbnailReflection(LibraryDocument library) {
		Boolean val = Boolean.valueOf(library.getLibrary().getPreferences().getThumbnailsReflection());
		return val;
	}

	public String thumbnailFormat(LibraryDocument library) {
		String val = library.getLibrary().getPreferences().getThumbnailsFormat();
		return val;
	}

	public String postersFormat(LibraryDocument library) {
		String val = library.getLibrary().getPreferences().getPostersFormat();
		return val;
	}
	
	public String getThumbPicture(LibraryDocument library) {
		String val = library.getLibrary().getMovies().getMovieArray(0).getThumbnail();
		return val;
	}
	
	public String season(LibraryDocument library) {
		String val = library.getLibrary().getMovies().getMovieArray(0).getSeason();
		return val;
	}
}
